/**
 * @Date 2025/1/15 10:59
 * @Created by 衡盛永
 */

package org.example.deploy.enums;

//@Describle 反编译字节码文件
//
// public final class PlayerType extends Enum
// {
//     public static PlayerType[] values()
//     {
//         return (PlayerType[])$VALUES.clone();
//     }
//     public static PlayerType valueOf(String name)
//     {
//         return (PlayerType)Enum.valueOf(com/cmower/baeldung/enum1/PlayerType, name);
//     }
//     private PlayerType(String s, int i)
//     {
//         super(s, i);
//     }
//     public static final PlayerType TENNIS;
//     public static final PlayerType FOOTBALL;
//     public static final PlayerType BASKETBALL;
//     private static final PlayerType $VALUES[];
//     static
//     {
//         TENNIS = new PlayerType("TENNIS", 0);
//         FOOTBALL = new PlayerType("FOOTBALL", 1);
//         BASKETBALL = new PlayerType("BASKETBALL", 2);
//         $VALUES = (new PlayerType[] {
//                 TENNIS, FOOTBALL, BASKETBALL
//         });
//     }

public enum PlayerType {
    TENNIS("乒乓球"),
    FOOTBALL("足球"),
    BASKETBALL("篮球");


    // 定义实例对应的参数
    private String msg;

    // 必写：通过此构造器给枚举值创建实例
    PlayerType(String msg) {
        System.out.println("看看此构造函数被调用了几次");
        // 枚举类中声明的每一枚举值其实都调用了构造函数并创建了实例，简单理解就是: 每一个枚举值都是一个实例对象。
        this.msg = msg;
    }

    // 通过此方法可以获取到对应实例的参数值
    public String getMsg() {
        return msg;
    }
}